<?php
/**
 * @filesource:					DeadTypeAction.class.php
 * @desc:						逝者类型管理模块
 * 
 * @author:						shenyaqing
 * @copyright:					hou.yining@gmail.com
 * @date:						2011-04-20
 */
class DeadTypeAction extends CommonAction{
	public function index(){
		$crumb_info = array(
			array('uri' => '__URL__', 'title' => L('deadtype_manage'), 'sort' => C('CRUMB_LAST')),
		);
		$this->_mergeCrumbInfo($crumb_info);
		$this->_action_link = array(
			array('uri' => '__URL__/add', 'title' => L('add_deadtype')),
		);
		$this->assign('crumb_info', $this->_crumb_info);
		$this->assign('action_link', $this->_action_link);
		parent::index();
	}
	public function add(){
		$crumb_info = array(
			array('uri' => '__URL__', 'title' => L('deadtype_manage'), 'sort' => C('CRUMB_DEFAULT')),
			array('uri' => '__URL__/add', 'title' => L('add_deadtype'), 'sort' => C('CRUMB_LAST')),
		);
		
		$this->_mergeCrumbInfo($crumb_info);
		$this->_action_link = array(
			array('uri' => '__URL__/index', 'title' => L('list_deadtype')),
			);
		
		$this->assign('crumb_info', $this->_crumb_info);
		$this->assign('action_link', $this->_action_link);
		parent::add();
	}
	public function edit(){
		$crumb_info = array(
			array('uri' => '__URL__', 'title' => L('deadtype_manage'), 'sort' => C('CRUMB_DEFAULT')),
			array('uri' => '__URL__/edit/id/' . $_REQUEST['id'], 'title' => L('edit_deadtype'), 'sort' => C('CRUMB_LAST')),
		);

		$this->_mergeCrumbInfo($crumb_info);
		$this->_action_link = array(
			array('uri' => '__URL__/index', 'title' => L('list_deadtype')),
			);
		
		$this->assign('crumb_info', $this->_crumb_info);
		$this->assign('action_link', $this->_action_link);
		parent::edit();
	}
	public function search(){
		
		$model = M ( 'dead_type' );
		//$result = parent::_search();
		$where = $_POST['search'];
		$result = $model->where("name='$where'")->select(); 
		$this->assign('list',$result);
		$this->display('index');
	}
	
}
?>
